#cs ----------------------------------------------------------------------------

	AutoIt Version: 3.3.8.1
	Author:         Parinya Sukhaporamet

	Script Function:
	Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
$runray = IniRead("set.ini", "Raycity", "PATH", "NotFound")
;~ MsgBox(266304, "Done", $runray, 10)

Func Beginray()
	If ProcessExists("Patcher.exe") Then
		ProcessClose("patcher.exe")
		Run($runray)
		updateray()
	Else
		Run($runray)
		updateray()

	EndIf
EndFunc   ;==>Beginray

Func updateray()
	WinActivate("patcher")
	Sleep(1000)
	ControlClick("Patcher", "", "Button10")
	Sleep(2000)
	closeray()
EndFunc   ;==>updateray

Func closeray()
	If ProcessExists("Raycity.exe") Then
		ProcessClose("raycity.exe")
	EndIf
EndFunc   ;==>closeray